package com.stone.serverless.web.domain;


import java.lang.reflect.Method;

/**
 * @Description: TODO
 * @Author: MECHREVO
 * @Date: 2022/1/21 10:52
 * @Version: 1.0.0
 */

public class ServerlessMethodRequestMappingInfo extends ServerlessClassRequestMappingInfo {

    Method method;


    public ServerlessMethodRequestMappingInfo() {
    }

    public ServerlessMethodRequestMappingInfo(ServerlessClassRequestMappingInfo methodServerlessRequestMappingInfo, Method publicMethod) {
        super();
        setMethod(publicMethod);
        setPaths(methodServerlessRequestMappingInfo.getPaths());
        setMethods(methodServerlessRequestMappingInfo.getMethods());
        setParams(methodServerlessRequestMappingInfo.getParams());
        setHeaders(methodServerlessRequestMappingInfo.getHeaders());
        setConsumes(methodServerlessRequestMappingInfo.getConsumes());
        setProduces(methodServerlessRequestMappingInfo.getProduces());
        setMappingName(methodServerlessRequestMappingInfo.getMappingName());
    }

    public Method getMethod() {
        return method;
    }

    public void setMethod(Method method) {
        this.method = method;
    }
    //
    //public static void copy(Object source, Object target) {
    //    ServerlessClassRequestMappingInfo.copy(source, target, null);
    //    ReflectUtil.setFieldValue(target, "method", ReflectUtil.getFieldValue(source, "method"));
    //}
}
